<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/uploadify/jquery.uploadify.min.js" ></script>
<link rel="stylesheet" charset="utf-8" type="text/css" href="__PUBLIC__/admin/js/uploadify/uploadify.css"> 
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/upload.js" ></script>
	
	
<!-- 用户列表 -->
<style>
	th {
		text-align: center;
	}
	
	.table>tbody>tr>td {
		line-height: 70px;
		text-align: center;
		height:70px;
		margin: 0px;
	}
	
.bg{ background: none; border: none;}
.uploadify-button-text{ display: inline-flex; }
.uploadify-button-text button{ margin: -10px; }
#iocn img{ height:90px; width: 120px; }
#iocn ul{ margin:0px; padding:0px; }
#iocn li{ margin:0px; padding:0px; position: relative; display:inline-block; width:120px; height:90px; background-position: center; background-size: contain; background-repeat: no-repeat; float: left; margin-right:10px; border:1px #ccc solid; background-color:#f0f0f0;}
#iocn li a{ display:inline-block; position: absolute; bottom:0px; left:0px; text-align:center; width:100%; background-color:rgba(0,0,0,0.3); color:red; cursor: pointer; }
#iocn li:hover a{ background-color:rgba(0,0,0,0.8); }
	
</style>
<div id="data_page" class="in_page">
	
		<div class="panel panel-default">
			<div class="panel-body">
				<form class="form-inline" method="get" name="keyword" id="keyword">
					<div class="form-group">
					版本控制
					</div>
					<div class="form-group" style="float: right;">
						<button type="button" class="btn btn-sm btn-primary" id="add" >添加新版本</button>
					</div>
				</form>
			</div>
		</div>
		
	<table class="table table-striped table-bordered table-condensed ">
		<thead>
			<tr>
				<th>系统</th>
				<th>链接地址</th>
				<th>更新内容</th>
				<th>版本号</th>
				<th>发布时间</th>
			</tr>
		</thead>
		<tbody>	
			<volist name="list" id="li">			
				<tr>
					<td>{$li.system}</td>
					<td>{$li.url}</td>
					<td>{$li.content}</td>
					<td style="text-align: center;">{$li.version}</td>
					<td style="text-align: center;">{$li.ctime}</td>
				</tr>
			</volist>
		</tbody>
	</table>

</div>
<div class="modal" id="addnewModal" style=" overflow:scroll; ">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h3>完善产品信息</h3>
			</div>
			<div class="modal-body">
				
				<form id="bjy-form" class=" form-horizontal"  method="post">
					<div class="form-group">
						 <label for="title" class="col-sm-2 control-label"  >链接地址:</label>
						<div class="col-sm-6">
							<select name="field" class="field_sel form-control">
								<option value="android">安卓</option>
								<option value="ios">苹果</option>
							</select>
						</div>
					</div>
					
					<div class="form-group">
						 <label for="title" class="col-sm-2 control-label"  >链接地址:</label>
						<div class="col-sm-6">
							<input type="url" class="form-control" id="url" placeholder="如：https://www.baidu.com/"/>
						</div>
					</div>
					<div class="form-group">
						 <label for="title" class="col-sm-2 control-label"  >更新内容:</label>
						<div class="col-sm-6">
							<textarea id="content">
								
							</textarea>
						</div>
					</div>
					<div class="form-group">
						 <label for="title" class="col-sm-2 control-label"  >版本号:</label>
						<div class="col-sm-6">
							<input type="url" class="form-control" id="version" placeholder="如：1.0"/>
						</div>
					</div>
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" id="close" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" id="submit" class="btn btn-primary" data-dismiss="modal">添加</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	//添加新版本
	$("#add").click(function(){
		$("#addnewModal").show();
	});
	$("#close").click(function(){
		$("#addnewModal").hide();
	});
	$("#submit").click(function(){
		var system	=$(".field_sel").val();
		var url	=	$("#url").val();
		var version=$("#version").val();
		var content=$("#content").val();
		if(system.length<1 || url.length<1 || version.length<1 || content.length<1){
			alert('每一项都不能为空');return false;
		}
		$.post("{:U('Index/version_add')}",{url:url,version:version,system:system,content:content},function(obj){
			alert(obj.m);
			history.go(0);
		});
	});
});
</script>